package org.jgs1904.spring.demo02.service.impl;

import org.springframework.aop.framework.AopContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author 墨苍璃
 * @date 2023年07月31日19时37分
 */
@Component
public class Perform {

    public void perform() {
        System.out.println("我正在表演");
    }


    @Autowired
    private Perform perform;

    /**
     * 解决代理失效
     */
    public void perform1() {
        perform.perform();
    }

    /**
     * 解决代理失效
     */
    public void perform2() {
        Perform currentProxy = (Perform) AopContext.currentProxy();
        currentProxy.perform();
    }

}
